package com.gjintel.framework.constant;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Constant {
    public static final String SAVE_SUCCESS = "saveSuccess";
    public static final String ROOT = "1";
    public static final String SAVE_UN_SUCCESS = "saveUnsuccess";
    public static final String APPLY_SUCCESS = "applySuccess";
    public static final String APPLY_UN_SUCCESS = "applyUnsuccess";
    public static final String APPROVE_SUCCESS = "approveSuccess";
    public static final String APPROVE_UN_SUCCESS = "approveUnsuccess";
    public static final String DEL_SUCCESS = "delSuccess";
    public static final String DEL_UN_SUCCESS = "delUnsuccess";
    public static final String BIND_SUCCESS = "bindSuccess";
    public static final String USER_NO_EXIST = "userNoExist";
    public static final String PSW_NO_RIGNT = "pswNoRight";
    public static final String LOGIN_SUCCESS = "loginSuccess";
    public static final String SUCCESS = "success";
    public static final String UNSUCCESS = "unsuccess";
    public static final String EXE_SUCCESS = "exeSuccess";
    public static final String LOGIN_USER = "loginUser";
    public static final String BIND_UNSUCCESS = "delUnsuccessOnWorkFlowRef";
    public static final String NO_END = "noEnd";
    public static final String DEL_COMMITED = "delCommited";
    public static final String HAVE_BINDED = "haveBinded";
    public static final String HAVE_COMMITED = "haveCommited";
    public static final String DEPT_TYPE_DEPT = "3";
    public static final String USER_NOT_LOGIN = "userNotLogin";
    public static final String NOT_FIND_GOODS = "notFindGoods";
    public static final String NOT_FIND_PROJECT = "notFindProject";
    public static final String GOODS_TYPE_NO_PROJECT = "goodsTypeNoProject";
    public static final String GOODS_STORAGE_NOT_FULL = "goodsStorageNotFull";
    public static final String EXISTS_LAST_PRICE_GOODS = "existsLastPriceGoods";
    public static final String REGISTER_UN_COMPLETE = "registerUnComplete";// 填写信息不完整,请完善后重新提交!
    public static final String REGISTER_SUCCESS = "registerSuccess";// 用户注册成功
    public static final String REGISTER_UN_SUCCESS = "registerUnSuccess";// 用户注册不成功,请重新提交!
    public static final String REGISTER_SUCCESS_UN_COMPLETE = "registerSuccessUnComplete";// 用户注册成功!是否完善相册资料，等待管理员审核?
    public static final String REGISTER_USER_LOGIN_SUCCESS = "registerUserloginSuccess";// 未认证或未认证成功用户登录
    public static final String OTHER_USER_LOGIN = "otherUserLogin"; // 管理员登录
    public static final String USER_LOGIN_SUCCESS = "userLoginSuccess";
    public static final String LOGIN_TYPE_ERROR = "loginTypeError";// 登录方式不匹配
    public static final String CHANGE_LOGIN_TYPE = "changeLoginType";// 非投标人密码不能登录
    public static final String REGISTER_REPEAT = "register_repeat";// 注册用户重复
    public static final String COMPANY_REPEAT = "company_repeat";// 注册用户重复
    public static final String NO_IMAGE_01 = "no_image_01";
    public static final String NO_IMAGE_02 = "no_image_02";
    public static final String UNLOGIN = "unLogin";
    public static final String UPDATE_SUCCESS = "updateSuccess";
    public static final String UPDATE_UN_SUCCESS = "updateUnSuccess";
    public static final String PROJECT_TYPE_SAVE_SUCCESS = "projectTypeSaveSuccess";
    public static final String PROJECT_TYPE_SAVE_UNSUCCESS = "projectTypeSaveUnsuccess";
    public static final String REGISTER_UN_AUDIT = "registerUnAudit";// 投标人未审核
    public static final String REGISTER_UN_PASS = "registerUnPass";// 投标人审核未通过
    public static final String REGISTER_UN_PASS_AUDIT = "registerUnAuditPass";// 投标人未审核或者审核不通过
    public static final String REASON_NULL = "reasonnull";
    /*** 禁止投标 */
    public static final String PROJECT_NO_BID_SAVE_UNSUCCESS = "nobid";

    public static final String WAIT_AUDIT = "waitaudit";

    /*** 未到时间禁止提交 */
    public static final String NO_BID_SUBMIT_UNSUCCESS = "nosubmitbid";

    public static final String AUDITING = "0";// 暂停审核中

    public static final String AUDITING_PASS = "1";// 暂停审核通过

    public static final String AUDITING_UN_PASS = "2";

    public static final String PROJECT_RESTORE = "3";

    public static final String PROJECT_REVOKE = "4";

    public static final String PROJECT_FLOW = "5";

    /**
     * 已经投过标了
     */
    public static final String EXIT_BID = "exitbid";

    /**
     * 封存用户不能投标
     */
    public static final String SEALUP_NOBID = "sealupNobid";

    /**
     * 相同银行账号 用户
     */
    public static final String SAME_ACCOUNT = "sameAcount";


    public static final Integer DEPOSIT_RETURN = 1; // 保证金退还
    public static final Integer DEPOSIT_DEDUCT = 2; // 保证金扣除
    public static final Integer DEPOSIT_UN_RETURN = 0; //保证金未退还
    public static final Integer FAILE_RETURN = -1; //保证金退还失败


    /**
     * 没有资格投标(协议，单项保证金未缴纳)
     */
    public static final String NO_QUALIFICA_BID = "noqualificabid";

    /**
     * 没有注册项目类型资格
     */
    public static final String NO_REG_QUALIFICA_BID = "noregqualificabid";

    public static final String PROJECT_CATEGORY_NOT_RIGHT = "projectCategoryRight";

    public static final String SUBMIT_REPEAT = "submitRepeat";

    public static final String PATH_CLASS_ROOT = Constant.class.getClassLoader().getResource("").getPath();

    public static final String ROOT_Path = PATH_CLASS_ROOT.substring(0,
            PATH_CLASS_ROOT.length() - "WEB-INF\\classes\\".length());

    /**
     * 不可完成保证金退还
     */
    public static final String UN_PASS = "unPass";
    /**
     * 全部保证金退还
     */
    public static final String ALL_RERURN = "allreturn";
    /**
     * 存在扣除状态
     */
    public static final String UN_ALL_RERURN = "unallreturn";
    /**
     * 竞价公示暂停
     */
    public static final String BIDDING_PAUSE = "0";
    /**
     * 中标公示暂停
     */
    public static final String WIN_BIDDING_SHOW_PAUSE = "1";
    /**
     * 竞价公示暂停 按钮数据库对应ID
     */
    public static final String BIDDING_PAUSE_BUTTON = "27";
    /**
     * 中标公示暂停  按钮数据库对应Id
     */
    public static final String WIN_BIDDING_SHOW_PAUSE_BUTTON = "28";
    /**
     * 竞价公示暂停 按钮数据库对应ID(不评标)
     */
    public static final String BIDDING_PAUSE_BUTTON_NB = "2010";
    /**
     * 中标公示暂停  按钮数据库对应Id(不评标)
     */
    public static final String WIN_BIDDING_SHOW_PAUSE_BUTTON_NB = "2011";
    /*
     * 各种任务 的名称
     */
    public static final String TASK_ASSIGN_NAME = "分配受理人";
    public static final String TASK_ASSIGN_ID = "utDeploy";

    /**
     * 有效标
     */
    public static final int EFFECTIVE = 1;

    /**
     * 无效标
     */
    public static final int INVALID = 2;

    /**
     * 未评标
     */
    public static final int NOEVALUATIONCOUNT = 0;


    // 任务名称 结束
    /**
     * 投标保证金0
     */
    public static final int DEPOSIT_TYPE_BIDDER = 0; //投标保证金
    /**
     * 履约保证金1
     */
    public static final int DEPOSIT_TYPE_EXECUTE = 1;//履约保证金

    /**
     * 保证金 ： 银行户名或开户行与系统帐户名或开户行不一致
     */
    public static final String ATYPISM = "atypism";

    /**
     * 不评标项目验收报告打印(中标人)
     */
    public static String NB_PRINT_RECEIVINGREPORT_OPERATION;

    /**
     * 不评标项目中标通知书打印
     */
    public static String NB_WINBIDALERT_OPERATION;

    /**
     * 流标内容，投标单位不足三家
     */
    public static String FLOW_CONTENT;

    /*** 银行超时***/
    public static String BANK_TIME_OUT = "bankTimeOut";

    /*** 未缴纳履约保证金***/
    public static String NO_EXECTUE_DEPOSIT = "noExecuteDeposit";

    public enum FileType {
        VIDEO, PICTURE
    }

    public enum UserType {
        ISP
    }

    public enum ShopPicType {
        LOGO, BANNER, PPT1, PPT2, PPT3, PPT4, PPT5
    }

    public enum GoodsPicType {
        VIEW, SHOW1, SHOW2, SHOW3, SHOW4, VEDIO
    }

    public enum RightType {
        SAME_LEVEL_USER, SAME_LEVEL_DEPT, SAME_LEVEL_BUY_SET, SAME_LEVEL_BIDDING_SET, SAME_LEVEL_ORDER_REDO
    }

    private static String SOAPServerPath;

    /**
     * 撤销操作
     */
    public static String CANCEL_OPERATION;

    /**
     * 项目详情操作
     */
    public static String DETAILS_OPERATION;

    /**
     * 项目投标操作
     */
    public static String PROJECTSHOT_OPERATION;

    /**
     * 上传合同操作
     */
    public static String UPLOADCONTRACT_OPERATION;

    /**
     * 打印合同操作
     */
    public static String PRINTCONTRACT_OPERATION;

    /**
     * 打印验收报告
     */
    public static String PRINT_RECEIVINGREPORT_OPERATION;

    /**
     * 上传验收报告
     */
    public static String UPLOAD_RECEIVINGREPORT_OPERATION;

    /**
     * 变更项目编号操作
     */
    public static String EDITPROJECTCODE_OPERATION;

    /**
     * 中标人打印中标通知书操作
     */
    public static String WINBIDALERT_OPERATION;

    /*** 投标人撤销*/
    public static String PROJECTCANCELSHOT_OPERATION;

    /*** 查看资料*/
    public static String VIEWFILE_OPERATION;


    /**
     * 终止项目
     **/
    public static String CANCLE_PROJECT;

    /**
     * 管理+审核角色id
     */
    public static String ADMINAUDITER_ID;

    /**
     * 供应商角色id
     */
    public static String SHOPER_ID;

    /**
     * 投标方角色id
     */
    public static String BIDDER_ID;

    /**
     * 超级管理员角色id
     */
    public static String SUPERADMIN_ID;

    /**
     * 受理分配角色id
     */
    public static String ASSIGN_ID;

    /**
     * 项目负责人角色id
     */
    public static String MANAGE_ID;

    /**
     * 采购人角色id
     */
    public static String BUY_ID;

    /**
     * 审核员角色id
     */
    public static String AUDIT_ID;

    /**
     * 监督员角色id
     */
    public static String SUPERVISOR_ID;

    /**
     * 业务管理角色id
     */
    public static String BUSINESSADMIN_ID;

    /**
     * 管理员角色id
     */
    public static String ADMIN_ID;

    /**
     * 评标角色id
     */
    public static String EVALUATIONEXPERT_ID;

    /**
     * 是否开启流程为使用测试
     */
    public static Boolean IS_TEST_PROCESSINSTANCE = false;

    /**
     * 系统设置配置信息id
     */
    public static String DATASET_ID;

    /**
     * 质疑
     **/
    public static String QUERY;
    /**
     * 投诉
     **/
    public static String COMPLAIN;
    /**
     * 答疑
     **/
    public static String ANSWER;
    /**
     * 处理结果
     **/
    public static String RESULT;

    /**
     * 投标人部门Id
     **/
    public static String REGISTER_DEPT_ID;

    /**
     * 投标人部门名称
     **/
    public static String REGISTER_DEPT_NAME;

    /**** 保证金明细 ****/
    public static String RETURN_DEPOSIT_DETAIL;

    /**** 货物类****/
    public static String PROJECTCATAGORY_GOODSID;
    /**** 服务类****/
    public static String PROJECTCATAGORY_SERVICEID;
    /**** 工程类****/
    public static String PROJECTCATAGORY_ENGINEERINGID;
    /****  产权类****/
    public static String PROJECTCATAGORY_PROPERTYID;
    /**** 租赁类*****/
    public static String PROJECTCATAGORY_RENT;
    /**** 处置类*****/
    public static String PROJECTCATAGORY_TRANSFER;

    /*** 工程类响应文件默认值*/
    public static String ENGINEERING_RESOINSEFILE;

    /**
     * 未交履约保证金未退
     **/
    public static String UNPAY_EXECUTE_UNRETURN = "402884845a354747015a3554b8630003";

    /**
     * 已交履约保证金未退
     **/
    public static String PAY_EXECUTE_UNRETURN = "402884845a354747015a3555681a0005";

    /**
     * 已交履约保证金已退
     **/
    public static String PAY_EXECUTE_RETURN = "402884845a354747015a35561b650007";

    /**
     * 履约保证金已退(全退)
     **/
    public static String ALL_DEPOSIT_RETURN = "402884845a35e0bf015a35e21a230001";

    /**
     * 不评标货物类响应文件
     */
    public static String NB_GOODS_RESPONSEFILE;

    /**
     * 不评标服务类响应文件
     */
    public static String NB_SERVICE_RESPONSEFILE;

    /**
     * 不评标工程类响应文件
     */
    public static String NB_ENGINEERING_RESPONSEFILE;

    /**
     * 采购人选择最低价3
     */
    public static final Integer CHOOSE_TYPE_SYSTEMCHOICE = 3;

    /**
     * 采购人选择中标单位1
     */
    public static final Integer CHOOSE_TYPE_BUYERCHOICE = 1;
    /**
     * 采购人选择流标2
     */
    public static final Integer CHOOSE_TYPE_BUYER_FLOW_DOWN = 2;

    /**
     * 采购人超时未选择，系统默认选择最低价中标
     */
    public static final Integer CHOOSE_TYPE_SYSTEM_CHOOSE_MIN = 4;

    /**
     * 有效标不足三家系统自动流标
     */
    public static final Integer CHOOSE_TYPE_SYSTEM_LESS3_Flow = 5;


    /**
     * 产权人选择竞拍结果类型 选择通过
     */
    public static final int OWNER_CHOOSE_AUCTION_RESLUT_TYPE_SUCCESS = 0;

    /**
     * 产权人选择竞拍结果类型 选择流标
     */
    public static final int OWNER_CHOOSE_AUCTION_RESLUT_TYPE_FLOW = 1;
    /**
     * 产权人选择竞拍结果类型 没有竞拍人自动流标
     */
    public static final int OWNER_CHOOSE_AUCTION_RESLUT_TYPE_AUTO_FLOW = 2;
    /**
     * 产权人选择竞拍结果类型 超时流标
     */
    public static final int OWNER_CHOOSE_AUCTION_RESLUT_TYPE_OUT_TIME_FLOW = 3;

    static {
        Properties prop = new Properties();
        InputStream is = Constant.class.getClassLoader().getResourceAsStream("ca.properties");

        Properties constantProp = new Properties();
        InputStream constantIs = Constant.class.getClassLoader().getResourceAsStream("constant.properties");

        try {
            prop.load(is);
            constantProp.load(constantIs);

            SOAPServerPath = prop.getProperty("SOAPServerPath");
            RETURN_DEPOSIT_DETAIL = constantProp.getProperty("depositReturnDetail");
            CANCEL_OPERATION = constantProp.getProperty("canceloperation");
            DETAILS_OPERATION = constantProp.getProperty("detailsoperation");
            IS_TEST_PROCESSINSTANCE = Boolean.parseBoolean(constantProp.getProperty("istestprocessinstance"));
            DATASET_ID = constantProp.getProperty("datasetid");
            PROJECTSHOT_OPERATION = constantProp.getProperty("projectshotoperation");
            UPLOADCONTRACT_OPERATION = constantProp.getProperty("uploadcontractoperation");
            PRINTCONTRACT_OPERATION = constantProp.getProperty("printContractoperation");
            UPLOAD_RECEIVINGREPORT_OPERATION = constantProp.getProperty("uploadreceivingoperation");
            WINBIDALERT_OPERATION = constantProp.getProperty("winbidalertoperation");
            CANCLE_PROJECT = constantProp.getProperty("cancleproject");
            QUERY = constantProp.getProperty("query");
            COMPLAIN = constantProp.getProperty("complain");
            ANSWER = constantProp.getProperty("answer");
            RESULT = constantProp.getProperty("result");
            REGISTER_DEPT_ID = constantProp.getProperty("registerdeptid");
            REGISTER_DEPT_NAME = constantProp.getProperty("registerdeptname");
            EDITPROJECTCODE_OPERATION = constantProp.getProperty("editprojectcodeoperation");
            PRINT_RECEIVINGREPORT_OPERATION = constantProp.getProperty("printReceivinReportoperation");

            PROJECTCATAGORY_GOODSID = constantProp.getProperty("projectCatagorygoodsId");
            PROJECTCATAGORY_SERVICEID = constantProp.getProperty("projectCatagoryserviceId");
            PROJECTCATAGORY_ENGINEERINGID = constantProp.getProperty("projectCatagoryengineeringId");
            PROJECTCATAGORY_PROPERTYID = constantProp.getProperty("projectCatagorypropertyId");
            ENGINEERING_RESOINSEFILE = constantProp.getProperty("engineeringresoinsefile");
            PROJECTCANCELSHOT_OPERATION = constantProp.getProperty("projectcancelshotoperation");
            VIEWFILE_OPERATION = constantProp.getProperty("viewfileoperation");
            FLOW_CONTENT = constantProp.getProperty("flowcontent");
            NB_PRINT_RECEIVINGREPORT_OPERATION = constantProp.getProperty("nbprintreceivingreportoperation");
            NB_WINBIDALERT_OPERATION = constantProp.getProperty("nbwinbidalertoperation");
            NB_GOODS_RESPONSEFILE = constantProp.getProperty("nbgoodsresponsefile");
            NB_SERVICE_RESPONSEFILE = constantProp.getProperty("nbserviceresponsefile");
            NB_ENGINEERING_RESPONSEFILE = constantProp.getProperty("nbengineeringresponsefile");
            PROJECTCATAGORY_RENT = constantProp.getProperty("projectRent");
            PROJECTCATAGORY_TRANSFER = constantProp.getProperty("projectTransfer");
        } catch (IOException e) {
        }
    }

    public static String getSOAPServerPath() {
        return SOAPServerPath;
    }
}
